package org.qiyu.live.bank.provider.rpc;

import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboService;
import org.qiyu.live.bank.dto.AccountTradeReqDTO;
import org.qiyu.live.bank.dto.AccountTradeRespDTO;
import org.qiyu.live.bank.interfaces.IQiyuCurrencyAccountRpc;
import org.qiyu.live.bank.provider.service.IQiyuCurrencyAccountService;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2023-11-03
 * Time: 19:18
 */
@DubboService
public class QiyuCurrencyAccountRpcImpl implements IQiyuCurrencyAccountRpc {

    @Resource
    private IQiyuCurrencyAccountService accountService;

    @Override
    public void incr(Long userId, int num) {
        accountService.incr(userId, num);
    }

    @Override
    public void decr(Long userId, int num) {
        accountService.decr(userId, num);
    }

    @Override
    public Integer getBalance(Long userId) {
        return accountService.getBalance(userId);
    }

    @Override
    public AccountTradeRespDTO consumeForGift(AccountTradeReqDTO accountTradeReqDTO) {
        return accountService.consumeForGift(accountTradeReqDTO);
    }

//    @Override
//    public AccountTradeRespDTO consume(AccountTradeReqDTO accountTradeReqDTO) {
//        return accountService.consume(accountTradeReqDTO);
//    }
}